<div class="modal fade bs-modal-lg" id="modelContent">
	<div class="modal-dialog modal-lg">
        <div class="modal-content"></div>
    </div>
</div> 

<div class="portlet box green">
   
    <div style="background-color: rgb(249, 247, 161);">
		<label >
	</label>
	</div>
    <div class="portlet-body">
    	
		<div class="portlet-body form">
		   	<form action="/service/list" class="form-horizontal" method="get" id="searchForm" onsubmit="return false">
				<div class="form-body">
					<div class="row">
						<div class="col-md-3">
							<label class="col-md-4 control-label">单号：</label>
							<div class="col-md-8">
						    	<input type="text" class="form-control" name="id" value="$!searchModel.id">
							</div>
						</div>
						
						
		    		</div>
		    		<div class="row">
		    		&nbsp;<br/>
		    		</div>
		    		<div class="row">
						
						<div class="col-md-2">
							<div class="actions col-md-12">
								<a href="javascript:;" class="btn green btn-sm ajax-search"><i class="fa fa-search"></i>查询 </a>
								<a href="javascript:;" class="btn green btn-sm search-reset"><i class="fa fa-eraser"></i> 清除 </a>
							</div>
						</div>
						<br>
		      	
		    		</div>
				</div>
				
			</form>
		</div>
		
    	<div class="dataTables_wrapper no-footer">
			<div class="table-scrollable">
			     <table class="table table-striped table-bordered table-hover">
				  	<thead>
						<tr>
		   		 			<th>企业ID</th>
		   		 			<th>企业名称</th>
		   		 			<th>企业分类</th>
		   		 			<th>企业会员等级</th>
		   		 			<th>所属行业</th>
		   		 			<th>信用额度</th>
		   		 			<th>信用余额</th>
		   		 			<th>负责人姓名</th>
		   		 			<th>负责人会员号</th>
		   		 			<th>注册日期</th>
		   		 			<th class="col-md-2">操作</th>
						</tr>
					</thead>
					<tbody>
					#foreach($item in $pageCompany.result)
					#set($cata=$!cataMap.get($item))
					#set($industry=$!industryMap.get($item))
					#set($level=$!levelMap.get($item))
		  			#set($user=$!userMap.get($!item))
		  				<tr>  
						    <td>$!item.id</td>
						    <td>$!item.name</td>
						    <td>$!cata.name</td>
						    <td>$!level.name</td>
						    <td>$!industry.name</td>
						    <td>$!item.credits</td>
						    <td>$!item.creditOver</td>
						    <td>$!user.realname</td>
						    <td>$!item.userId</td>
						    <td>$!item.regtime</td>
						    <td>
						       if($!item.)
						    	<a class="btn green btn-outline btn-sm addProtect" thref="$!item.id"  target="_blank"> 
									<i class="fa fa-plus"></i>加入维保
								</a>
								<input type="hidden" value="$!item.id">
								
						    </td>		
		  				</tr>
					#end
					</tbody>
				</table>
				 
			</div>
			<!-- $!queryString -->
			#set($page=$pageCompany)
			#set($pageUrl="/addServiceCompany/helpOrder?name=$!name&pageNo=")
			#parse("_pageModel.htm")
		</div>
    </div>
</div>
<script src="/assets/scripts/views-date.js" type="text/javascript"></script>
<script type="text/javascript">
ComponentsSelect2.initWithSearch();
$("input[name=code]").focus();
var pageContentBody = $('.page-content .page-content-body');

function getcbvalue(){
	var array = new Array()
	var target= $("input[name='checkboxes']");
	//循环加入数组
	
		$.each(target,function(i,v){
			if(v.checked){
				array.push($(v).val());
			}
		});
	 	return array; 
 }
 
$(".addProtect").click(function(){
	
       var id=$(this).next().val();
   
			$.post("/addServiceCompany/project", {
				"id" : id
			}, function(result) {
				if (result.code == 0) {
					toastr.success(result.msg);
					pageContentBody.load("/addmyCompany/list");
				} else {
					toastr.warning(result.msg);
				}
			}, "json");
		
	

})

/**
 * 批量删除
 */
/* $(".delete-tab").click(function(){
	  var pIdArray= getcbvalue();
	  if(pIdArray.length>0){
 		bootbox.setLocale("zh_CN");
		bootbox.confirm("确定删除这些商品吗？", function(state) {
			if(state){
			   	 $.post("/productSale/deleteProduct",{"pIdArray":pIdArray},function(result){
		        	if(result.code==0){
		        		toastr.success(result.msg);
		       			pageContentBody.load("/productSale/list");
		       		}else {
		       			toastr.warning(result.msg);
		       		}
			   },"json");
			}
		});
	  }
}) */



  /**
      *
      * excel 导出
      */
     $(".export-tab").click(function(){
    	 var pIdArray= getcbvalue();
    	 if(pIdArray.length>0){
   		    $("#pid").val(pIdArray);
   		    $("#downfile").attr("action","/downloadExcel");
   			$("#downfile").submit();
    	 }else{
    		 toastr.warning("请选择商品");
    	 }
     })
     /*
      *  excel 导出全部
      */
     $(".export-all").click(function(){
	    	$("#pid").val("");
  		    $("#downfile").attr("action","/downloadExcel");
  			$("#downfile").submit();
     })
     
     /**
      *
      * 获得 鼠标点击坐标
      */
     function getMousePos(event) {
            var e = event || window.event;
            var scrollX = document.documentElement.scrollLeft || document.body.scrollLeft;
            var scrollY = document.documentElement.scrollTop || document.body.scrollTop;
            var x = e.pageX || e.clientX + scrollX;
            var y = e.pageY || e.clientY + scrollY;
            return { 'x': x, 'y': y };
      }
      
      
      
 	$(".resultsTable .searchBtn").on("click",function(){
		var url = $(this).attr("thref");
		alert(url+"地址")
		$.ajax({
			url: url,
			type: "get",
			dataType: "html",
			success: function(res){
				$(".resultsTable").html(res)
			},
			error: function (xhr, ajaxOptions, thrownError) {
	            pageContentBody.html('<h4>服务器异常，请与管理员联系.</h4>');
	            App.stopPageLoading();
	        }
			
		})
	})
</script>
